<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/iscTaglib.xml" prefix="isomorphic" %>
<%@ page import="java.util.*" %>
<%@ page import="com.isomorphic.rpc.*" %>
<%@ page import="com.isomorphic.datasource.*" %>
<%@ page import="com.isomorphic.sql.*" %>
<%@ page import="com.isomorphic.log.*" %>
<%@ page import="com.isomorphic.util.*" %>
<%
String roles =  (String)session.getAttribute("roles");
if(!"comAdmin".equals(roles) && !"depAdmin".equals(roles)){
	response.sendRedirect("login.jsp");
	return;
}
Map user = (Map)session.getAttribute("currUser");

//获得当前公司短信标识,不从user中直接获取是怕信息过时
DataSource companyDS;

//获得datasource
try {
	companyDS = DataSourceManager.getDataSource("companyDS");
} catch (Exception e) {
    throw new Exception("Could not load company ds");
}
Map company = companyDS.fetchById(user.get("corp_sid"));
Object limit = company.get("ms_limit");
if(limit == null){
	limit = false;
}
%>
<HTML><HEAD><TITLE>系统管理</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<!--  -->
<isomorphic:loadISC skin="Graphite"/>
</HEAD><BODY class=""  style="overflow:hidden" >
<script src="isomorphic/locales/frameworkMessages_zh_CN.properties.js"></script> 
<SCRIPT>
isc.setAutoDraw(false);

// Load DataSources
// ---------------------------------------------------------------------
<isomorphic:loadDS name="customerDS"/>
<isomorphic:loadDS name="customer_categoryDS"/>
<isomorphic:loadDS name="companyDS"/>
<isomorphic:loadDS name="depDS"/>
<isomorphic:loadDS name="user"/>
<isomorphic:loadDS name="blackDS"/>
<isomorphic:loadDS name="sms_config"/>
<isomorphic:loadDS name="sms_task"/>
<isomorphic:loadDS name="mms"/>
// Set up the app img dir so we pick up the example's images
//isc.Page.setAppImgDir("[APP]images/");

var currUserPK = '<%=user.get("pk") %>';
var  currUserCorpSid = '<%=user.get("corp_sid") %>';
var roles = '<%=roles %>';
var currUserTruename= '<%=user.get("truename") %>';
var currUserTelephone = '<%=user.get("telephone") %>';
var currComMsLimit = <%=limit.toString() %>;

</SCRIPT>

<!--  Pick up application UI and logic from the .js UI file
  ======================================================================
-->

<script type="text/javascript">

</SCRIPT>
<script src="admin.js"></script>
<script src="reloginFlow.js"></script>
<script type="text/javascript">
		isc.HLayout.create({
			ID:"frameTopSetLayout",
			width: 200,vAglin:"bottom",
			members: [
				isc.Label.create({
					width: "80",
					contents: "<div style='cursor:pointer'>客户管理</div>",
					icon: "khgl.gif",
					click:"window.location.href='index.jsp';"
				}),
				isc.Label.create({
					width: "80",
					contents: "<div style='cursor:pointer'>退出系统</div>",
					icon: "topIcon.png",
					click:"window.location.href='login.jsp';"
				})
			]
		});


isc.HLayout.create({
	ID:"frameTopLayout",
	width: "100%",
	height:"71",
	memberOverlap:350,
	members: [
		isc.StretchImg.create({
			src: "top.jpg",
			vertical:false,
			zIndex:10,
			height:"71",
			items:[
					{name:"start", width:"0"},
					{name:"stretch", width:"*"},
					{name:"end", width:"313"}
			   ]
		})
		,frameTopSetLayout
	]
});



isc.VLayout.create({
	ID:"frameLayout",
	width:"100%",
	height:"100%",
    layoutMargin:10,
	members:[
		frameTopLayout,
		isc.HLayout.create({
			ID:"frameContentLayout",
			width: "100%",
			height:"100%",
			members: [
				isc.SectionStack.create({
					width:120,
					showResizeBar:true,
					visibilityMode:"multiple",
					animateSections:true,
					sections:[
						{title:"导航", autoShow:true, items:[
							isc.ListGrid.create({
								ID:"navList",
								width: "100%",leaveScrollbarGap:false,
								cellHeight:33,showHeader :false,
								fields:[
									{name:"appImgSrc", type:"image", width:24, im2gDir:"pieces/16/"},
									{name:"appName"}
								],
								selectionChanged  : function(record,state){
									frameRightLayout.setMembers([record.appID]);
								}
							}) 
					
						]}
					]
				}),

				isc.VLayout.create({
					ID:"frameRightLayout",
					width:"100%",
					height:"100%",
					top:10,
					members:[]
				})
			]
		})
	]
});
isc.Page.setEvent("load", function(){
	var data =[
			{appName:"组织机构",appImgSrc:"rygl.gif",appID:"orgLayout"}
			,{appName:"信息配额",appImgSrc:"010.jpg",appID:"appLimt"}
			<%if("comAdmin".equals(roles)){%>
			,{appName:"短信配制",appImgSrc:"czgl.gif",appID:"smConfigApp"}
			,{appName:"彩信配制",appImgSrc:"czgl.gif",appID:"mmsConfigApp"}
			,{appName:"黑名单",appImgSrc:"icon_delete.png",appID:"blackApp"}
			<%}%>
		];
	navList.setData(data);
	frameLayout.draw();
	navList.selectSingleRecord(0);
});
</script>
</BODY>
</HTML>
